-
-
Notifications
You must be signed in to change notification settings - Fork 59
feat: PlayStation native support #2433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Core sentry functions use obsolete preprocessor directive
The csproj was changed to define SENTRY_NATIVE_PLAYSTATION instead of SENTRY_NATIVE_STATIC, but the core native functions (sentry_init, sentry_close, sentry_get_crashed_last_run, sentry_clear_crashed_last_run, sentry_reinstall_backend) still check #if SENTRY_NATIVE_STATIC. Since this symbol is never defined, these functions will always use [DllImport("sentry")] instead of [DllImport("__Internal")]. This is inconsistent with vsnprintf_sentry which correctly uses SENTRY_NATIVE_PLAYSTATION for static linking on PlayStation, and could cause the native SDK to fail to load on platforms expecting static linking.
src/Sentry.Unity.Native/SentryNativeBridge.cs#L299-L333
sentry-unity/src/Sentry.Unity.Native/SentryNativeBridge.cs
Lines 299 to 333 in f687907
| #if SENTRY_NATIVE_STATIC | |
| [DllImport("__Internal")] | |
| #else | |
| [DllImport("sentry")] | |
| #endif | |
| private static extern int sentry_init(IntPtr options); | |
| #if SENTRY_NATIVE_STATIC | |
| [DllImport("__Internal")] | |
| #else | |
| [DllImport("sentry")] | |
| #endif | |
| private static extern int sentry_close(); | |
| #if SENTRY_NATIVE_STATIC | |
| [DllImport("__Internal")] | |
| #else | |
| [DllImport("sentry")] | |
| #endif | |
| private static extern int sentry_get_crashed_last_run(); | |
| #if SENTRY_NATIVE_STATIC | |
| [DllImport("__Internal")] | |
| #else | |
| [DllImport("sentry")] | |
| #endif | |
| private static extern int sentry_clear_crashed_last_run(); | |
| #if SENTRY_NATIVE_STATIC | |
| [DllImport("__Internal")] | |
| #else | |
| [DllImport("sentry")] | |
| #endif | |
| private static extern void sentry_reinstall_backend(); |
src/Sentry.Unity.Native/Sentry.Unity.Native.csproj#L16-L17
sentry-unity/src/Sentry.Unity.Native/Sentry.Unity.Native.csproj
Lines 16 to 17 in f687907
| OutputAssembly="$(OutDir)Sentry.Unity.Native.PlayStation.dll" | |
| DefineConstants="$(DefineConstants);SENTRY_NATIVE_PLAYSTATION" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: PlayStation sentry functions use dynamic instead of static linking
The old SENTRY_NATIVE_STATIC conditional compilation for sentry functions was removed, but SENTRY_NATIVE_PLAYSTATION only applies to vsnprintf_sentry. All actual sentry-native functions (sentry_init, sentry_options_new, sentry_close, etc.) now unconditionally use [DllImport("sentry")] for dynamic linking. If PlayStation requires static linking (as the old Console build did), these function calls will fail with DllNotFoundException because they're looking for a "sentry" dynamic library instead of using __Internal for statically linked symbols.
src/Sentry.Unity.Native/SentryNativeBridge.cs#L115-L117
sentry-unity/src/Sentry.Unity.Native/SentryNativeBridge.cs
Lines 115 to 117 in 8a6a41c
| // libsentry.so | |
| [DllImport("sentry")] | |
| private static extern IntPtr sentry_options_new(); |
src/Sentry.Unity.Native/SentryNativeBridge.cs#L297-L311
sentry-unity/src/Sentry.Unity.Native/SentryNativeBridge.cs
Lines 297 to 311 in 8a6a41c
| [DllImport("sentry")] | |
| private static extern int sentry_init(IntPtr options); | |
| [DllImport("sentry")] | |
| private static extern int sentry_close(); | |
| [DllImport("sentry")] | |
| private static extern int sentry_get_crashed_last_run(); | |
| [DllImport("sentry")] | |
| private static extern int sentry_clear_crashed_last_run(); | |
| [DllImport("sentry")] | |
| private static extern void sentry_reinstall_backend(); |
Resolves #2050
#skip-changelog